/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package vista;

import java.awt.Color;
import javax.swing.JOptionPane;
import modelo.Caldera;
import modelo.Llave;
import modelo.Tanque;

/**
 *
 * @author sebastian
 */
public class Vista extends javax.swing.JFrame {

    /**
     * Creates new form Vista
     */
    
    private Caldera caldera;
    
    public Vista() {
        initComponents();
        
        //this.setBounds(50, 50, 800, 570);
        this.setTitle("AUTOMATIZACIÓN Y CONTROL DE PROCESOS");
        this.setResizable(false);
        if (this.controlador1 != null) {
            Tanque tanque = new Tanque(300, 25, this.jpgrsTemp, this.jpgrsNivel, this.jlblValNivel, this.jlblValTemperatura, 135, 400, 0);
            Llave q1 = new Llave(1,this.jsldrQ1, this.lblMedQ1, this.jpgrsCaudalQ1);
            Llave q2 = new Llave(2,this.jsldrQ2, this.lblMedQ2, this.jpgrsCaudalQ2);
            this.caldera = new Caldera(100, 3, 25, this.lblTempCaldera, tanque);
            this.controlador1.recibir(tanque, q1, q2, caldera, this.jpgrsTemp, jpgrsCaudalQ1, jpgrsCaudalQ2, this.jsldrVelocidad.getValue());
            Thread hilo = new Thread(controlador1);
            hilo.start();
            Thread hiloCaldera = new Thread(caldera);
            hiloCaldera.start();
        }
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        controlador1 = new controlador.Controlador();
        jsldrQ1 = new javax.swing.JSlider();
        jsldrQ2 = new javax.swing.JSlider();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jLabel23 = new javax.swing.JLabel();
        jLabel24 = new javax.swing.JLabel();
        jLabel25 = new javax.swing.JLabel();
        jpgrsTemp = new javax.swing.JProgressBar();
        jpgrsNivel = new javax.swing.JProgressBar();
        jpgrsCaudalQ1 = new javax.swing.JProgressBar();
        jpgrsCaudalQ2 = new javax.swing.JProgressBar();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jlblValTemperatura = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jlblValNivel = new javax.swing.JLabel();
        lblMedQ1 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        lblMedQ2 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        jSeparator1 = new javax.swing.JSeparator();
        jLabel16 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        jLabel20 = new javax.swing.JLabel();
        jLabel21 = new javax.swing.JLabel();
        jLabel22 = new javax.swing.JLabel();
        jLabel26 = new javax.swing.JLabel();
        jLabel27 = new javax.swing.JLabel();
        jLabel28 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        lblTempCaldera = new javax.swing.JLabel();
        jLabel29 = new javax.swing.JLabel();
        jsldrVelocidad = new javax.swing.JSlider();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jsldrQ1.setBackground(Color.RED);
        jsldrQ1.setMaximum(50);
        jsldrQ1.setValue(25);
        jsldrQ1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jsldrQ1.setEnabled(false);

        jsldrQ2.setMaximum(50);
        jsldrQ2.setValue(0);
        jsldrQ2.setEnabled(false);

        jLabel8.setFont(new java.awt.Font("Lucida Grande", 0, 8)); // NOI18N
        jLabel8.setForeground(new java.awt.Color(255, 255, 255));
        jLabel8.setText("Cerrado");

        jLabel9.setFont(new java.awt.Font("Lucida Grande", 0, 8)); // NOI18N
        jLabel9.setForeground(new java.awt.Color(255, 255, 255));
        jLabel9.setText("Abierto");

        jLabel11.setFont(new java.awt.Font("Lucida Grande", 0, 8)); // NOI18N
        jLabel11.setForeground(new java.awt.Color(255, 255, 255));
        jLabel11.setText("Medio");

        jLabel23.setForeground(new java.awt.Color(255, 0, 0));
        jLabel23.setText("Candela");

        jLabel24.setFont(new java.awt.Font("Lucida Grande", 0, 8)); // NOI18N
        jLabel24.setForeground(new java.awt.Color(255, 255, 255));
        jLabel24.setText("0%");

        jLabel25.setFont(new java.awt.Font("Lucida Grande", 0, 8)); // NOI18N
        jLabel25.setForeground(new java.awt.Color(255, 255, 255));
        jLabel25.setText("100%");

        javax.swing.GroupLayout controlador1Layout = new javax.swing.GroupLayout(controlador1);
        controlador1.setLayout(controlador1Layout);
        controlador1Layout.setHorizontalGroup(
            controlador1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, controlador1Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jLabel8)
                .addGap(45, 45, 45)
                .addComponent(jLabel11)
                .addGap(36, 36, 36)
                .addComponent(jLabel9)
                .addGap(54, 54, 54))
            .addGroup(controlador1Layout.createSequentialGroup()
                .addGap(152, 152, 152)
                .addComponent(jLabel23)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGroup(controlador1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(controlador1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(controlador1Layout.createSequentialGroup()
                        .addComponent(jsldrQ1, javax.swing.GroupLayout.PREFERRED_SIZE, 136, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jsldrQ2, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(70, 70, 70))
                    .addGroup(controlador1Layout.createSequentialGroup()
                        .addComponent(jLabel24)
                        .addGap(115, 115, 115)
                        .addComponent(jLabel25)
                        .addGap(297, 297, 297))))
        );
        controlador1Layout.setVerticalGroup(
            controlador1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(controlador1Layout.createSequentialGroup()
                .addGap(80, 80, 80)
                .addGroup(controlador1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel24)
                    .addComponent(jLabel25, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jsldrQ1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jLabel23)
                .addGap(8, 8, 8)
                .addComponent(jsldrQ2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(controlador1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(jLabel9)
                    .addComponent(jLabel11))
                .addGap(131, 131, 131))
        );

        jpgrsTemp.setMaximum(120);
        jpgrsTemp.setOrientation(1);

        jpgrsNivel.setMaximum(300);
        jpgrsNivel.setOrientation(1);
        jpgrsNivel.setBorderPainted(false);

        jpgrsCaudalQ1.setMaximum(50);
        jpgrsCaudalQ1.setOrientation(1);

        jpgrsCaudalQ2.setMaximum(50);
        jpgrsCaudalQ2.setOrientation(1);
        jpgrsCaudalQ2.setInheritsPopupMenu(true);

        jLabel1.setText("Nivel Tanque");

        jLabel2.setText("Temperatura");

        jLabel3.setText("Caudal Q1");

        jLabel4.setText("Caudal Q2");

        jLabel5.setText("Valor actual:");

        jlblValTemperatura.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jlblValTemperatura.setText("0");

        jLabel7.setText("Valor actual:");

        jlblValNivel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jlblValNivel.setText("0");

        lblMedQ1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblMedQ1.setText("0");

        jLabel10.setText("Valor actual:");

        lblMedQ2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblMedQ2.setText("0");

        jLabel12.setText("Valor actual:");

        jLabel13.setFont(new java.awt.Font("Lucida Grande", 0, 18)); // NOI18N
        jLabel13.setText("MEDIDAS");

        jLabel14.setFont(new java.awt.Font("Lucida Grande", 0, 8)); // NOI18N
        jLabel14.setText("0 Lts");

        jLabel15.setFont(new java.awt.Font("Lucida Grande", 0, 8)); // NOI18N
        jLabel15.setText("300 Lts");

        jButton1.setText("Parada de emergencia");

        jLabel16.setFont(new java.awt.Font("Lucida Grande", 0, 8)); // NOI18N
        jLabel16.setForeground(new java.awt.Color(255, 0, 0));
        jLabel16.setText("225 Lts");

        jLabel17.setFont(new java.awt.Font("Lucida Grande", 0, 8)); // NOI18N
        jLabel17.setText("0 Lts/s");

        jLabel18.setFont(new java.awt.Font("Lucida Grande", 0, 8)); // NOI18N
        jLabel18.setText("10 Lts/s");

        jLabel19.setFont(new java.awt.Font("Lucida Grande", 0, 8)); // NOI18N
        jLabel19.setText("5 Lts/s");

        jLabel20.setFont(new java.awt.Font("Lucida Grande", 0, 8)); // NOI18N
        jLabel20.setText("0 Lts/s");

        jLabel21.setFont(new java.awt.Font("Lucida Grande", 0, 8)); // NOI18N
        jLabel21.setText("10 Lts/s");

        jLabel22.setFont(new java.awt.Font("Lucida Grande", 0, 8)); // NOI18N
        jLabel22.setText("5 Lts/s");

        jLabel26.setFont(new java.awt.Font("Lucida Grande", 0, 8)); // NOI18N
        jLabel26.setText("0 ºC");

        jLabel27.setFont(new java.awt.Font("Lucida Grande", 0, 8)); // NOI18N
        jLabel27.setForeground(new java.awt.Color(255, 0, 0));
        jLabel27.setText("100 ºC");

        jLabel28.setFont(new java.awt.Font("Lucida Grande", 0, 8)); // NOI18N
        jLabel28.setText("120 ºC");

        jLabel6.setText("Temperatura caldera:");

        jLabel29.setText("Velocidad:");

        jsldrVelocidad.setMaximum(1000);
        jsldrVelocidad.setMinimum(1);
        jsldrVelocidad.setValue(1);
        jsldrVelocidad.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jsldrVelocidadStateChanged(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(controlador1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(layout.createSequentialGroup()
                            .addGap(2, 2, 2)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(layout.createSequentialGroup()
                                    .addGap(131, 131, 131)
                                    .addComponent(jLabel13))
                                .addGroup(layout.createSequentialGroup()
                                    .addGap(36, 36, 36)
                                    .addComponent(jLabel2)
                                    .addGap(83, 83, 83)
                                    .addComponent(jLabel1))
                                .addGroup(layout.createSequentialGroup()
                                    .addGap(56, 56, 56)
                                    .addComponent(jpgrsTemp, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(1, 1, 1)
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jLabel28)
                                        .addComponent(jLabel27)
                                        .addComponent(jLabel26, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGap(90, 90, 90)
                                    .addComponent(jpgrsNivel, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(2, 2, 2)
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jLabel15)
                                        .addComponent(jLabel16)
                                        .addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addGroup(layout.createSequentialGroup()
                                    .addGap(40, 40, 40)
                                    .addComponent(jLabel5)
                                    .addGap(92, 92, 92)
                                    .addComponent(jLabel7))
                                .addGroup(layout.createSequentialGroup()
                                    .addGap(40, 40, 40)
                                    .addComponent(jlblValTemperatura, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(92, 92, 92)
                                    .addComponent(jlblValNivel, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(layout.createSequentialGroup()
                                    .addGap(53, 53, 53)
                                    .addComponent(jLabel3)
                                    .addGap(105, 105, 105)
                                    .addComponent(jLabel4))
                                .addGroup(layout.createSequentialGroup()
                                    .addGap(65, 65, 65)
                                    .addComponent(jpgrsCaudalQ1, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(2, 2, 2)
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jLabel18)
                                        .addComponent(jLabel19)
                                        .addComponent(jLabel17, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGap(88, 88, 88)
                                    .addComponent(jpgrsCaudalQ2, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(4, 4, 4)
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jLabel21)
                                        .addComponent(jLabel22)
                                        .addComponent(jLabel20, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addGroup(layout.createSequentialGroup()
                                    .addGap(50, 50, 50)
                                    .addComponent(jLabel10)
                                    .addGap(92, 92, 92)
                                    .addComponent(jLabel12))
                                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 339, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGroup(layout.createSequentialGroup()
                                    .addGap(50, 50, 50)
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(layout.createSequentialGroup()
                                            .addComponent(jLabel6)
                                            .addGap(18, 18, 18)
                                            .addComponent(lblTempCaldera))
                                        .addGroup(layout.createSequentialGroup()
                                            .addComponent(lblMedQ1, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(92, 92, 92)
                                            .addComponent(lblMedQ2, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE))))))
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jButton1)
                            .addGap(79, 79, 79)))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jLabel29)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jsldrVelocidad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(16, 16, 16))))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(controlador1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(layout.createSequentialGroup()
                .addGap(6, 6, 6)
                .addComponent(jLabel13)
                .addGap(24, 24, 24)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel2)
                    .addComponent(jLabel1))
                .addGap(2, 2, 2)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel28)
                        .addGap(20, 20, 20)
                        .addComponent(jLabel27)
                        .addGap(100, 100, 100)
                        .addComponent(jLabel26))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel15)
                        .addGap(30, 30, 30)
                        .addComponent(jLabel16)
                        .addGap(90, 90, 90)
                        .addComponent(jLabel14))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(4, 4, 4)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jpgrsTemp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jpgrsNivel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addGap(6, 6, 6)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel5)
                    .addComponent(jLabel7))
                .addGap(6, 6, 6)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jlblValTemperatura)
                    .addComponent(jlblValNivel))
                .addGap(38, 38, 38)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel3)
                    .addComponent(jLabel4))
                .addGap(2, 2, 2)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel18)
                        .addGap(60, 60, 60)
                        .addComponent(jLabel19)
                        .addGap(60, 60, 60)
                        .addComponent(jLabel17))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel21)
                        .addGap(60, 60, 60)
                        .addComponent(jLabel22)
                        .addGap(60, 60, 60)
                        .addComponent(jLabel20))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(4, 4, 4)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jpgrsCaudalQ1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jpgrsCaudalQ2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addGap(10, 10, 10)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel10)
                    .addComponent(jLabel12))
                .addGap(4, 4, 4)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblMedQ1)
                    .addComponent(lblMedQ2))
                .addGap(19, 19, 19)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6)
                    .addComponent(lblTempCaldera))
                .addGap(18, 18, 18)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel29)
                    .addComponent(jsldrVelocidad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 11, Short.MAX_VALUE)
                .addComponent(jButton1)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jsldrVelocidadStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jsldrVelocidadStateChanged
               this.controlador1.cambiarVelocidad(this.jsldrVelocidad.getValue());
               this.caldera.setVelocidad(this.jsldrVelocidad.getValue());
    }//GEN-LAST:event_jsldrVelocidadStateChanged

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Vista.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Vista.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Vista.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Vista.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Vista().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private controlador.Controlador controlador1;
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JLabel jlblValNivel;
    private javax.swing.JLabel jlblValTemperatura;
    private javax.swing.JProgressBar jpgrsCaudalQ1;
    private javax.swing.JProgressBar jpgrsCaudalQ2;
    private javax.swing.JProgressBar jpgrsNivel;
    private javax.swing.JProgressBar jpgrsTemp;
    private javax.swing.JSlider jsldrQ1;
    private javax.swing.JSlider jsldrQ2;
    private javax.swing.JSlider jsldrVelocidad;
    private javax.swing.JLabel lblMedQ1;
    private javax.swing.JLabel lblMedQ2;
    private javax.swing.JLabel lblTempCaldera;
    // End of variables declaration//GEN-END:variables
}
